/* File: run_all_analysis.do
 * Author: Luca Maini
 * Purpose: runs all the .do files producing paper and presentation Figures and 
 *			Tables
 *
 * Date Created: 01/12/2022
 *
 */

set more off
clear all
capture log close
set matsize 10000
set maxvar 10000

* Graphics parameters
set scheme tufte
global paperFont "Helvetica"
global OAFont "Palatino Linotype"

global purple "86 1 164"
global navy "13 61 86"
global ruby "154 37 21"
global alice "16 120 149"
global daisy "235 201 68"
global coral "242 109 33"
global kelly "130 147 86"
global cranberry "230 65 115"
global jet "19 21 22"
global asher "85 95 97"
global slate "49 79 79"

* Set directories 
* (EDIT THIS LINE TO MATCH YOUR HOME DIRECTORY WHEN WORKING WITH THIS FILE)
global db "E:\Dropbox (Personal)\Luca\Research\1. Active Projects\Master work with Josh\Pharmaceutical Mergers\submissions\JPE Micro\Final submission files\Replication folder\"

global dodir "${db}\analysis"
global logdir "${db}\logfiles"

global maindir "${db}\data\main"
global outdir "${db}\data\output"
global inputdir "${db}\data\input"
global paperdir "${db}\output\paper"
global presdir "${db}\output\presentation"
global otheroutputdir "${db}\output\other"
global coeffdir "${db}\output\coefficients"

* open log file
log using "${logdir}\run_all_analysis_${S_DATE}.txt", text replace

* run scripts
do "${dodir}\1. acquisitions_summary_stats.do"
do "${dodir}\2. drug_summary_stats.do"
do "${dodir}\3. matched_regression_analysis.do"
do "${dodir}\3b. matched_regression_analysis_noatc3.do"
do "${dodir}\4. matched_analysis_paper_graphs.do"
do "${dodir}\4b. matched_analysis_paper_graphs_noatc3.do"
do "${dodir}\5. run_stacked_DiD.do"
do "${dodir}\5b. run_stacked_DiD_noatc3.do"
do "${dodir}\6. formulary_exclusion_test.do"
do "${dodir}\7. valeant_plots.do"
do "${dodir}\8. einav_overlap_comparison.do"

capture log close
